package com.qfedu.zf.life.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.qfedu.zf.life.entity.Image;
import com.qfedu.zf.life.mapper.ImageMapper;
import com.qfedu.zf.life.service.ImageService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author wjw
 * @since 2024-06-20
 */
@Service
public class ImageServiceImpl extends ServiceImpl<ImageMapper, Image> implements ImageService {

    @Autowired
    private ImageMapper imageMapper;

    public List<Image> getImagesByPostId(Long postId) {
        QueryWrapper<Image> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("post_id", postId);
        return imageMapper.selectList(queryWrapper);
    }

}
